def bubble_sort(li):
    n = len(li)
    for i in range(n -1):
        count = 0
        for j in range(n - i - 1):
            if li[j] > li[j+1]:
                li[j],li[j+1] = li[j+1],li[j]
                count += 1
        if 0 == count:
            break

li = [1,33,23,12,44,5,22]
bubble_sort(li)
for tem in li:
    print(tem)